export type PageInfo = {
  pageIndex?: number | string;
  pageSize?: number | string;
};

export function toSequelizeOptions(pageInfo: PageInfo) {
  const { pageIndex = 1, pageSize = 10 } = pageInfo;
  return {
    limit: Number(pageSize),
    offset: (Number(pageIndex) - 1) * Number(pageSize),
  };
}
